<template>
	<view>
		题目标题：{{title.title}}<br>
		题目描述：{{title.descriptor}}<br>
		<view v-if="title.radio">
			<u-radio-group v-model="title.studentanser">
				<u-radio v-for="(item,index) in title.candicated" :key="index" :name="item.name">
					{{item.name}}
				</u-radio>
			</u-radio-group>
		</view>
		<view v-if="!title.radio">
			<u-checkbox-group @change="checkboxGroupChange">
				<u-checkbox @change="checkboxChange" v-model="item.checked" v-for="(item,index) in title.candicated"
					:key="index" :name="item.name">
					{{item.name}}
				</u-checkbox>
			</u-checkbox-group>
		</view>
		<view v-if="title.isAnswer">
			{{title.answer}} 
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
			// 选中某个复选框时，由checkbox时触发
			checkboxChange(e) {
				//console.log(e);
			},
			// 选中任一checkbox时，由checkbox-group触发
			checkboxGroupChange(e) {
				// console.log(e);
			}
		},
		props: ["title"]
	}
</script>

<style>

</style>
